﻿//
// Created: 2018/8/14
// Author: chenqiang
//
using System.Data.Entity;
using System.Data.Entity.ModelConfiguration;
using Model.Admin;

namespace Model.Admin.Map
{
    internal  class AdminRoleMap:EntityTypeConfiguration< AdminRole >    
    {
        public AdminRoleMap()
        {
             this.ToTable("Admin_Role");
             this.HasKey(i => new { i.ID });
             this.Property(i => i.ID).HasColumnName("ID");                     
             this.Property(i => i.RoleId).HasColumnName("RoleId");                     
             this.Property(i => i.RoleName).HasColumnName("RoleName");                     
             this.Property(i => i.RoleDesc).HasColumnName("RoleDesc");                     
             this.Property(i => i.CreateTime).HasColumnName("CreateTime");                     
             this.Property(i => i.Creator).HasColumnName("Creator");                     
             this.Property(i => i.UpdateTime).HasColumnName("UpdateTime");                     
             this.Property(i => i.Updator).HasColumnName("Updator");                     
             this.Property(i => i.Enable).HasColumnName("Enable");                     
             this.Property(i => i.RoleIcon).HasColumnName("RoleIcon");                     
        }   
    }
    
     public static class AdminRoleMapExtensions
    {
        public static void UserAdminRoleMap(this DbModelBuilder pModelBuilder)
        {
            pModelBuilder.Configurations.Add(new AdminRoleMap());
        }
    }
}